package org.example.minebackend.pojo.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.example.minebackend.pojo.Invitation;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class InvitationDetailDTO {
    private String writerName;
    @JsonProperty("nOfFollowers")
    private Integer nOfFollowers;
    private String title;
    private String content;
    private String kind;
    private String image;
    @JsonProperty("nOfCollections")
    private int nOfCollections;
    private LocalDateTime createTime;
    public InvitationDetailDTO(Invitation invitation, String writerName, String image) {
        this.writerName = writerName;
        this.nOfFollowers = 0;
        this.title = invitation.getTitle();
        this.content = invitation.getContent();
        this.kind = invitation.getKind();
        this.nOfCollections = invitation.getNOfCollections();
        this.createTime = invitation.getCreateTime();
        this.image = image;
    }
}
